﻿@model WebPortal.Models.LogOnModel
@{
    Layout = "";
}
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
    <title>主数据管理平台登录</title>
    <style type="text/css">
        body
        {
            margin: 0px;
            background-color: #EDF5FF;
        }
        INPUT
        {
            font-size: 22px;
            width: 260px;
            height: 28px;
            background-color: #FFFFED;
            border: solid 1px #D5CCBE; 
        }
        .tx2
        {
            font-size: 18px;
            color: #999;
            margin-top: 60px;
        }
        .submitbuttom
        {
            background-color: #89D629;
            margin-top:3px;
            border: none;
            width: 265px;
            height: 35px;
            color: #ffffff;
            cursor: hand;
            font-size: 20px;
            font-weight: bold;
        }
        .input_tips
        {
            position: absolute;
            color: #aaa;
            top: 8px;
            left: 10px;
            cursor: text;
            z-index: 10;
        }
        .input_t
        {
            position: absolute;
            top: 3;
            left: 3;
        }
        .div_t
        {
            position: relative;
            height: 35px;
            width: 270px;
            margin-top: 3px;
        }
        .img_v
        {
            position: relative;
            margin-left: 3px;
            cursor: pointer;
            width: 70px;
            height: 31px;
        }
        #LoginInfo
        {
            width: 260px;
            height: 300px;
            text-align: left;
        }
    </style>
    <script src="@Url.Content("~/Scripts/jquery-1.8.0.min.js")" type="text/javascript"></script>
    <script src="@Url.Content("~/Scripts/jquery.validate.min.js")" type="text/javascript"></script>
    <script src="@Url.Content("~/Scripts/jquery.validate.unobtrusive.min.js")" type="text/javascript"></script>
    <script src="@Url.Content("~/Res/easyui/jquery.easyui.min.js")" type="text/javascript"></script>
    <script src="/Res/MyJs.js" type="text/javascript"></script>
    <script type="text/javascript">
        function btnReset() {
            $("#txt_UserPwd").val("");
            $("#valiCode").attr("src", function () {
                this.src = "/Account/CreateRandom?time=" + (new Date()).getTime();
            });
        }
        function SubmitForm() {
            if ($.trim($("#txt_UserName").val()) == "") {
                alert("请输入账户.");
                $("#txt_UserName").focus();
                return false;
            }
            if ($.trim($("#txt_UserPwd").val()) == "") {
                alert("请输入密码.");
                $("#txt_UserPwd").focus();
                return false;
            }
            $('#ff').form('submit', {
                url: '/Account/LogOn?time=' + (new Date()).getTime()
                , success: function (data) {
                    switch (data) {
                        case "-1":
                            alert('登陆失败，请检查输入的验证码！');
                            break;
                        case "0":
                            alert('登陆失败，请检查输入的用户名和密码！');
                            btnReset();
                            break;
                        case "1":
                            alert('登陆失败,登录错误次数超过3次，请30分钟后重试。');
                            btnReset();
                            break;
                        case "2":
                            alert('登陆失败，您没有登录的权限！');
                            break;
                        case "ok":
                            window.location.href = '/Home/Index';
                            break;
                        default:
                            alert("操作失败！");
                            break;
                    }
                }
            });
            return false;
        }
        $(function () {
            $("#valiCode").bind("click", function () {
                this.src = "/Account/CreateRandom?time=" + (new Date()).getTime();
            });
        })
        function getfocus(u) {
            $("." + u).html("");  
        }
        function getblur(u, id, t) {
            if ($.trim($("#" + id).val()) == "")
                $("." + u).html(t);
        }
    </script>
</head>
<body>
    <form id="ff" method="post">
    @Html.AntiForgeryToken()
    <table style="width: 100%; height: 100%" align="center" cellpadding="0" cellspacing="0"
        border="0">
        <tr>
            <td style="vertical-align: top;">
                <table style="width: 1021px;" align="center" cellpadding="0" cellspacing="0" border="0">
                    <tr>
                        <td valign="top" align="center" height="400">
                            <img src="/images/logo-mdp-2.png" style="margin-top: 100px; " />
                            <div id="LoginInfo">
                                <div class="tx2">
                                    账号密码登录</div>
                                <div class="div_t">
                                    <label class="input_tips u" onclick="getfocus('u');$('#txt_UserName').focus();">
                                        请输入账号...</label>
                                    <input type="text" name="txt_UserName" onfocus="getfocus('u')" onblur="getblur('u','txt_UserName','请输入账号...')"
                                        class="input_t" id="txt_UserName" maxlength="100" />
                                </div>
                                <div class="div_t">
                                    <label class="input_tips p"  onclick="getfocus('p');$('#txt_UserPwd').focus();">
                                        密码</label>
                                    <input type="password" name="txt_UserPwd" id="txt_UserPwd" onfocus="getfocus('p')" onblur="getblur('p','txt_UserPwd','密码')" class="input_t" maxlength="100" />
                                </div>
                                <div class="div_t">
                                    <label class="input_tips r"  onclick="getfocus('r');$('#txt_Randomint').focus();">
                                        验证码</label>
                                    <div class="input_t" style="width: 300px;">
                                        <input type="text" name="txt_Randomint" id="txt_Randomint" style="width: 185px; float: left" maxlength="4"
                                           onfocus="getfocus('r')" onblur="getblur('r','txt_Randomint','验证码')"  style="width: 185px;" />
                                        <img id="valiCode" alt="验证码" title="点击更换验证码" class="img_v" style="float: left" src="/Account/CreateRandom" />
                                    </div>
                                </div>
                                <input type="submit" value="登 录" class="submitbuttom" id="btnLogOn" onclick="return SubmitForm()" />
                            </div>
                        </td>
                    </tr>
                    <tr>
                        <td style="text-align: center; font-size: 12px">
                            <br />
                            <br />
                            <hr />
                            Copyright @@2019 花样年集团有限公司<br />
                            （建议使用IE7及以上浏览器）
                        </td>
                    </tr>
                </table>
            </td>
        </tr>
    </table>
    </form>
</body>
</html>
